package itcast.web.servlet;

import itcast.domain.Drom;
import itcast.domain.Outt;
import itcast.service.Drom_manageService;
import itcast.service.OuttService;
import itcast.service.impl.Drom_manageServiceImpl;
import itcast.service.impl.OuttServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/updateout_studentServlet")
public class Updateout_studentServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        //获取id
        String id=request.getParameter("id");
        //2.调用Service查询
        OuttService service=new OuttServiceImpl();
        Outt outt =service.findout_ById(id);
        //3.将Drom存入request
        request.setAttribute("outt",outt);
        //4.转发到updateDrom
        request.getRequestDispatcher("/systemadmin/out.jsp").forward(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        this.doPost(request,response);
    }
}
